package com.huike.web.controller.system;

import com.huike.clues.domain.SysDictType;
import com.huike.clues.service.ISysDictTypeService;
import com.huike.common.core.controller.BaseController;
import com.huike.common.core.domain.AjaxResult;
import com.huike.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;



@RestController
@RequestMapping("/system/dict/type")
public class SysDictTypeController extends BaseController {


    @Autowired
    private ISysDictTypeService sysDictTypeService;

    @GetMapping("/list")
    public TableDataInfo list(SysDictType sysDictType){
        startPage();
        List<SysDictType> list = sysDictTypeService.list(sysDictType);
        return getDataTable(list);
    }

    @GetMapping("/{dictId}")
    public AjaxResult getDetailsById(@PathVariable Long dictId) {
        return AjaxResult.success(sysDictTypeService.getDetailsById(dictId));
    }


    @PostMapping
    public AjaxResult add(@RequestBody SysDictType sysDictType) {
        sysDictTypeService.add(sysDictType);
        return AjaxResult.success();
    }



}
